module AreasHelper
  def ajax_areas_cargos
    html=<<HTML
    #{get_cargos_ajax}
    <p>
      <label for="area_id">Area:</label>
      #{select :area,:id,Area.all.collect{|a| [a.nombre.html_safe, a.id]},{:prompt=>"Seleccione un area"},
        {:onchange=>"getCargos($('#area_id').val())",:class => "required"}}
    </p>
    <p>
      <label for="cargo_id">Cargos:</label>
      <span id="select_cargos">#{select_tag "cargos","<option> Seleccione un cargo</option>"}</span>
    </p>
HTML
    html
  end
end
